﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
using System.Text.RegularExpressions;
using System.Web.UI.WebControls;

namespace Medianamik.Core
{
    public static class PostBack
    {
        public const string PostBackEventTarget = "__EVENTTARGET";
        public const string PostBackEventArgument = "__EVENTARGUMENT";
    }

    public static class Pages
    {
        public const string ContentManagementEdition = "/medianamik/contentmanagement/nodemanagement.aspx";
        public const string ContentManagementList = "/medianamik/contentmanagement/nodelist.aspx";
        public const string TypeSelectorWindow = "/medianamik/modalwindows/typeselectorwindow.aspx";
        public const string DeleteElementWindow = "/medianamik/modalwindows/DeleteNodeWindow.aspx";
        public const string Preview = "/medianamik/contentmanagement/previewFrame.aspx";
    }

    public static class MimeTypes
    {
        public const string Excel = "application/vnd.ms-excel";
    } 

    public static class DefaultParamNames
    {
        public const string PropertyId = "property";
        public const string HideTreeview = "hidetreeview";
        public const string ParentNodeID = "parent";
        public const string ParentNodeTypeID = "parent";
        public const string NodeID = "id";
        public const string TypeID = "type";
        public const string ReturnURL = "returnurl"; 
        public const string LimitToParentTypeId = "limit";
        public const string Culture = "culture";
        public const string Revision = "revision";
        public const string GroupsToExclude = "exclude";
    }

    public static class MedianamikConfigurations
    {
        public static readonly string LastResourcesUpdateKey = "ResourcesUpdatedOn";
    }

    public static class MedianamikTasks
    {
        public const string AddCacheRecycler = "AddCacheRecycler";
        public const string UpdateResources = "UpdateResources";
        public const string CleanUpNodeRevisions = "CleanUpNodeRevisions";
    }

    public static class UrlXml
    {
        public static readonly string ROOT_ELEMENT_NAME = "urls";
        public static readonly string URL_ELEMENT_NAME = "url";
        public static readonly string PATH_ATT_NAME = "path";
        public static readonly string WEBSITE_ATT_NAME = "website";
        public static readonly string NODE_ATT_NAME = "nodeid";
        public static readonly string INDEXATION_ATT_NAME = "excluded";
    }

    public static class ControlIDs
    {
        public const String LanguagePickerID = "345A12169C3C4A03AA05666B4641FB0B";
        public const String TreeViewID = "107A117B92B7403DAD1069CF766F5012";
        public const String BreadcrumbTrail = "01882A0D0676482CA3CCED4D662A90DF";
    }

    public static class QueryStringParamNames
    {
        public const String WebSiteId = "websiteid";
    }

    public static class PostBackConstants
    {
        public const string PostBackEventTarget = "__EVENTTARGET";
        public const string PostBackEventArgument = "__EVENTARGUMENT";
    }

    public static class ConfigurationSectionName
    {
        public const string MEDIANAMIK = "Medianamik";
        public const string CODE_GENERATION = "CodeGeneration";
        public const string FILTER_URL_CONFIGURATION = "FilterUrlConfiguration";
        //public const string CODE_COMPILATION = "CodeCompilation";
    }

    public static class ConfigurationPropertyName
    {
        public const string VIRTUAL_FILE_PATH_ASSEMBLIES = "VirtualFilePathAssemblies";
        public const string LOGIN_SUCCESS_URL = "loginSuccessUrl";
        public const string ENABLE_CACHE_RECYCLER = "enableCacheRecycler";
        public const string PATH_PICKER_FILES_PATH = "pathPickerFilesPath";
        public const string EMAIL_TEMPLATE_FOLDER_PATH = "emailTemplateFolderPath";
        public const string SEND_URLDICTIONARY_REPORT_TO = "sendUrlDictionaryReportTo";
        public const string SEND_URLDICTIONARY_REPORT = "sendUrlDictionaryReport";
        public const string NO_NODEPROPERTYVALUE_MODE = "noNodePropertyValueMode";
        public const string EDITOR_MAX_UPLOAD_FILE_SIZE = "editorMaxUploadFileSize";
        public const string MAGIC_SCRIPTS_TIMEOUT = "magicScriptsTimeout";
        public const string MAGIC_SCRIPTS_INDIVIDUAL_TIMEOUT = "magicScriptsIndividualTimeout";
        public const string MAXIMUM_REVISIONS = "maximumRevisions";
        public const string ENABLE_LOGGING = "enableLogging";
        public const string ENABLE_APPROBATION = "enableApprobation";

        public const string INVARIANT_CULTURE_VIEWS = "invariantCultureViews";
        


        public const string ENABLE_AUTO_RESOURCE_UPDATE = "enableAutoResourceUpdate";
        public const string RESOURCE_UPDATE_LIMIT = "resourceUpdateLimit";
        public const string RESOURCE_UPDATE_INTERVAL = "resourceUpdateInterval";
        public const string ENABLE_MULTI_LANGUAGE_FEATURES = "enableMultiLanguageFeatures";
        public const string LOG_CACHE_SIZE = "logCacheSize";
        public const string APPLICATION_ENVIRONMENT = "applicationEnvironment";
        public const string DAL_PROVIDER = "dalProvider";
        public const string PATH_BUILDER = "pathBuilder";
        public const string DEFAULT_PAGE_EXTENSION = "defaultPageExtension";
        public const string DEFAULT_EDITOR_CSS_FILE_PATH = "defaultEditorCSSFilePath";
        public const string INDEX_PATH = "indexPath";
        public const string ERROR_MANAGEMENT = "errorManagement";
        public const string ENABLE_EXTENSION_OF_APPROBATION = "enableExtensionOfApprobation";
        //public const string CHANGESCRIPTS_PATH = "changeScriptsPath";
        public const string ENABLE_TABLE_GENERATOR = "enableTableGenerator";

        

        public const string DEFAULT_RESOURCE_SET = "defaultResourceSet";

        public const string EDITOR_DOCUMENT_FILES_PATH = "editorDocumentFilesPath";
        public const string EDITOR_MEDIA_FILES_PATH = "editorMediaFilesPath";
        public const string EDITOR_IMAGE_FILES_PATH = "editorImageFilesPath";
        public const string EDITOR_FLASH_FILES_PATH = "editorFlashFilesPath";

        public const string EDITOR_MEDIA_FILES_EXTENSION = "editorMediaFilesExtension";
        public const string EDITOR_FLASH_FILES_EXTENSION = "editorFlashFilesExtension";
        public const string EDITOR_DOCUMENT_FILES_EXTENSION = "editorDocumentFilesExtension";
        public const string EDITOR_IMAGES_FILES_EXTENSION = "editorImageFilesExtension";

        public const string DEFAULT_EDITION_CULTURE_NAME = "defaultEditionCultureName";
        public const string DEFAULT_UI_CULTURE_NAME = "defaultUICultureName";
        public const string SQL_CACHE_DEPENDENCY_NAME = "sqlCacheDependencyName";

        public const string ENABLE_LOCK = "enableLock";
        public const string ULTIMATUM_LOCK = "ultimatumLock";

        public const string FILTER_URLS = "FilterUrls";
        public const string FILTER_URLS_FOR_REDIRECT = "FilterUrlsForRedirect";
        public const string FILTER_URLS_FOR_ERROR = "FilterUrlsForError";
        public const string FILTER_URLS_ALLOWNOEXTENSION = "AllowNoExtension";
        public const string CLIENT_TEMPLATES = "ClientTemplates";
        public const string NODE_TYPE_ICONS = "NodeTypeIcons";
        public const string CLIENT_LOGO_PATH = "clientLogoPath";

        public const string SUPPORT_MAIL_ADDRESS = "supportMailAddress";
        public const string WEBSITE_FROM_MAIL_ADDRESS = "websiteFromMailAddress";
        public const string ERROR_TO_MAIL_ADDRESS = "errorToMailAddress";
        public const string ERROR_FROM_MAIL_ADDRESS = "errorFromMailAddress";

        public const string CODE_GENERATION_PROVIDER_NAME = "ProviderName";
        public const string CODE_GENERATION_NAMESPACE = "Namespace";
        public const string CODE_GENERATION_BASEPAGE = "BasePage";
        public const string CODE_GENERATION_REFERENCE_ASSEMBLIES = "ReferenceAssemblies";
        public const string CODE_GENERATION_OUTPUT_PATH = "OutputPath";

        //public const string CODE_COMPILATION_REFERENCE_ASSEMBLIES = "ReferenceAssemblies";
        //public const string CODE_COMPILATION_OUTPUT_PATH = "OutputPath";
        //public const string CODE_COMPILATION_ASSEMBLY_NAME = "AssemblyName";

        public const string IMAGEPICKER_EDITOR_WIDTH = "imagePickerEditorWidth";
        public const string IMAGEPICKER_EDITOR_HEIGHT = "imagePickerEditorHeight";

        public const string IMAGEPICKER_MANAGER_WIDTH = "imagePickerManagerWidth";
        public const string IMAGEPICKER_MANAGER_HEIGHT = "imagePickerManagerHeight";

        public const string URL_ACTION_HANDLER = "urlActionHandler";

        public const string SYNCHRONIZER_VALIDATE_HIERARCHICAL_RULES = "syncValidateHierarchicalRules";
    }

    public static class ConfigurationPropertyDefaultValue
    {
        public const string DEFAULT_LOGIN_SUCCESS_URL = "~/Medianamik/MasterPanel.aspx";
        public const string DEFAULT_PATH_PICKER_FILES_PATH_VALUE = "/documents";
        public const string DEFAULT_EDITOR_DOCUMENT_FILES_PATH_VALUE = "/documents/pdf/";
        public const string DEFAULT_EDITOR_MEDIA_FILES_PATH_VALUE = "/documents/media/";
        public const string DEFAULT_EDITOR_IMAGE_FILES_PATH_VALUE = "/documents/images/";
        public const string DEFAULT_EDITOR_FLASH_FILES_PATH_VALUE = "/documents/flash/";
        public const bool DEFAULT_ERROR_MANAGEMENT = true;

        public const int DEFAULT_RESOURCE_UPDATE_LIMIT = 100;
        public const int DEFAULT_RESOURCE_UPDATE_INTERVAL = 300;

        public const int DEFAULT_IMAGEPICKER_EDITOR_WIDTH = 832;
        public const int DEFAULT_IMAGEPICKER_EDITOR_HEIGHT = 520;

        public const int DEFAULT_IMAGEPICKER_MANAGER_WIDTH = 694;
        public const int DEFAULT_IMAGEPICKER_MANAGER_HEIGHT = 440;

        public const string DEFAULT_EDITOR_IMAGES_FILES_EXTENSION = "";
        public const string DEFAULT_EDITOR_MEDIA_FILES_EXTENSION = "";
        public const string DEFAULT_EDITOR_DOCUMENT_FILES_EXTENSION = "";
        public const string DEFAULT_EDITOR_FLASH_FILES_EXTENSION = "";

        public const string SUBSONIC_DAL_PROVIDER = "Medianamik.Core.DAL.SubsonicDALProvider, Medianamik.Core";
        public const string DEFAULT_PATH_BUILDER = "Medianamik.Core.Urls.PathBuilder, Medianamik.Core";
        public const string DEFAULT_PAGE_EXTENSION = ".html";
        public const string WEBSITE_FROM_MAIL_ADDRESS = "support@absolunet.com";
        public const string SUPPORT_MAIL_ADDRESS = "support@absolunet.com";
        public const string ERROR_FROM_MAIL_ADDRESS = "error@absolunet.com";
        public const string ERROR_TO_MAIL_ADDRESS = "error@absolunet.com";

        public const string DEFAULT_SQL_CACHE_DEPENDENCY_NAME = "Medianamik.Client";
        public const string DEFAULT_ASSEMBLY_NAME = "Medianamik.Client.DAL.dll";
        public const string DEFAULT_NAMESPACE = "Medianamik.Client.DAL";
        public const string DEFAULT_PROVIDER_NAME = "CodeGenerationProvider";
        public const string DEFAULT_BASEPAGE = "System.Web.UI.Page";
        public const string CUSTOM_USING_STATEMENTS = "using System.Linq;using System.Xml.Linq;using Medianamik.Core.Sugar;using Medianamik.Core;using Medianamik.Core.DAL;using System.Web;using Medianamik.Client.Data; /* Ajouter les Using nécessaires à la compilation */";

        public const string DEFAULT_CODE_COMPILATION_OUTPUT_PATH = "/bin/";
        public const string DEFAULT_CODE_GENERATION_OUTPUT_PATH = "/Data/";
        public static readonly string[] REFERENCES = { "mscorlib.dll", "System.dll", "System.Data.dll", "System.Configuration.dll", "System.Xml.dll", "System.Web.dll" };

        //Editor
        public const string DEFAULT_EDITOR_CSS_FILE_PATH_VALUE = "/includes/editeur.css";
        public const string DEFAULT_CLIENT_LOGO_PATH = "/images/logo_client.gif";
        //public const string DEFAULT_CHANGESCRIPTS_PATH = "/medianamik/DB/Change Scripts";

        public const string URL_ACTION_HANDLER = "Medianamik.UI.Controls.UrlActionHandler, Medianamik.UI";
    }

    public static class CookieName
    {
        public const string CULTURE_COOKIE = "MedianamikCultureCookie";
    }

    public enum MedianamikControlType : byte
    {
        DEFAULT = 0,
        LOOKUP = 1,
        MANY_TO_MANY = 2,
        REVERSE_LOOKUP = 3,
    }

    public static class MedianamikTypes
    {
        public static readonly Guid BaseType = new Guid("51942f57-8542-4d47-8e18-533bcda9e4b6");
        public static readonly Guid BaseWebType = new Guid("F7757F24-42C8-4B50-8910-0828F8C8B96D");
        public static readonly Guid WebSite = new Guid("44eb974b-6871-4879-a0c9-c596b42ff945");
        public static readonly Guid WebPage = new Guid("6a8fffbc-03be-4d06-9b98-cf2a093c4505");
        public static readonly Guid Module = new Guid("627e47fc-6c91-444f-b3a6-79b1f687ef9a");
        public static readonly Guid Domain = new Guid("6d1e47df-c715-4c0b-9986-e6d1ba6a5db8");
        public static readonly Guid MedianamikPage = new Guid("3dad4d08-b9bc-4603-a8de-42a88a354b5b");
        public static readonly Guid BaseContentType = new Guid("30ba97ab-c437-4c85-8d9d-77fb428d3d16");
        public static readonly Guid MedianamikUser = new Guid("bc72b93d-bac2-4f32-ae89-494ecba6a2d1");
        public static readonly Guid MedianamikRole = new Guid("2ef8a1a0-d2af-472d-8cf4-e86d941fc66a");
        public static readonly Guid MedianamikGroup = new Guid("33ded6a8-7988-4378-b525-b6f9f46b0fac");
        public static readonly Guid MedianamikProfile = new Guid("45c90cda-e48d-4f9e-a5a4-1c398b9dd5f5");
        public static readonly Guid MedianamikLock = new Guid("CF2886B9-FF1C-4A34-A96F-E21FDEDDFDB9");
        public static readonly Guid MedianamikModule = new Guid("627e47fc-6c91-444f-b3a6-79b1f687ef9a");
        public static readonly Guid MedianamikRedirect = new Guid("30224fd8-c92d-4498-b159-e916292b336c");
        public static readonly Guid MedianamikPageTemplate = new Guid("0d9d1aa8-2c70-4402-abd1-6cc028024967");
        public static readonly Guid MedianamikTemplate = new Guid("3f22f613-83fe-4f19-af04-6f1b0615b971");
        public static readonly Guid MedianamikSyndication = new Guid("66a9f142-1f8b-4d69-b8a7-bd92dcb23771");
        public static readonly Guid MedianamikDomain = new Guid("6D1E47DF-C715-4C0B-9986-E6D1BA6A5DB8");
        public static readonly Guid MedianamikMenuGroup = new Guid("c0b56f78-44eb-4e20-a1a8-3e0d56f008a3");
        public static readonly Guid WebSiteProxy = new Guid("af4d27eb-5245-41dc-aa1c-dfa0b7d9c899");
        public static readonly Guid MedianamikExternalRedirect = new Guid("413282ad-8427-472a-93a8-5ad3ecd223aa");
        public static readonly Guid Document = new Guid("95114D79-769F-4AA9-BA53-AFD81704DDC6");
    }

    public static class SeachResultPages
    {
        public static readonly Guid ContentManagement = new Guid("3b1989e7-3f49-4a77-9b4d-39526d8213b6");
        public static readonly Guid TypeManagement = new Guid("82b337dc-8e2e-4101-aea5-46081d08f666");
    }

    public static class MedianamikGroups
    {
        public static readonly Guid SuperAdmins = new Guid("48849835-9843-43bc-b277-152d1d8775de");
        public static readonly string LoweredSuperAdminGroupName = "superadmins";
    }

    public static class MedianamikUsers
    {
        public static readonly Guid SA = new Guid("53503b94-c176-4ad3-84e0-8764398cdbe4");
    }

    public static class MedianamikProfiles
    {
        public static readonly Guid SA = new Guid("9015081C-523C-42A6-A81D-105F8B337DDE");
    }

    public static class MedianamikModules
    {
        public static readonly Guid ContentManagement = new Guid("F091E77F-76DB-421B-87AB-8AD4C2155175");
        public static readonly Guid ConfigManagement = new Guid("7a6a4803-1d66-40f5-8dab-76afdae93cf0");
        public static readonly Guid RedirectManagement = new Guid("fb3d8335-5691-457b-b0a5-10aa9f933e03");
        public static readonly Guid TypeManagement = new Guid("6272f569-4d7b-4903-bfb8-8a61d16cf79b");
        public static readonly Guid FileManagement = new Guid("ea60c7c0-99fd-4c23-bc65-ac0f757689c6");
        public static readonly Guid SecurityManagement = new Guid("53d05866-f126-4875-a658-c8054cfdaee2");
        public static readonly Guid ForumManagement = new Guid("6C09A5B6-D454-4BFA-BE7D-3AA1BB57AB78");
        public static readonly Guid ActiveDirectoryManagement = new Guid("3E6D397B-854C-4362-BCB6-7C5639C8D347");

    }

    public static class MedianamikRoles
    {
        public const string ManageMedianamik = "ManageMedianamik";
        public const string ManageRoles = "ManageRoles";
        public const string PublishContent = "PublishContent";
        public const string ManageResources = "ManageResources";
        public const string ManageSecurity = "ManageSecurity";
        public const string ManageRedirects = "ManageRedirects";
        public const string ManageContent = "ManageContent";
        public const string DeleteAllInstancesOfANode = "DeleteAllInstancesOfANode";
        public const string ManageTemplates = "ManageTemplates";
        public const string ManageUsers = "ManageUsers";
        public const string MoveNode = "MoveNode";
        public const string ManageGroups = "ManageGroups";
        public const string Medianamik = "Medianamik";
        public const string ElementActivationManagement = "ElementActivationManagement";
    }

    public static class MedianamikProperties
    {
        #region Membership

        public static readonly Guid RoleName = new Guid("FC8517B2-971D-43A3-A6BE-35F386E79BF0");
        public static readonly Guid UserName = new Guid("69DCAF86-66D2-405C-ACFE-8820D9D436DD");
        public static readonly Guid GroupName = new Guid("AA53605C-76A0-45A1-9784-6D0F9B93F540");
        public static readonly Guid ProfileUser = new Guid("88bee7b1-6d91-46cd-88cc-180e5324cb4c");

        #region Lock

        public static readonly Guid Lock_Transation = new Guid("1A8F41D5-4536-41B8-A753-82E9140B7923");
        public static readonly Guid Lock_LockedObject = new Guid("D93D02F1-4CFC-4D13-9A74-C0BECD42D9C1");

        #endregion

        #endregion

        #region MedianamikTemplate

        public static readonly Guid MedianamikTemplateWebSiteId = new Guid("a679ce08-2556-46c4-934f-4612fb31d8ad");

        #endregion

        public static readonly Guid WebPageModuleId = new Guid("a5f1d87f-3086-4cea-a983-a09d4fe9fc4c");
        public static readonly Guid Url = new Guid("aba46c94-62ee-4d10-b977-1c6272ead48d");
        public static readonly Guid MedianamikModuleAlias = new Guid("12179708-3e1b-4e30-a654-b762e9e3159c");
        public static readonly Guid MedianamikPageFileName = new Guid("47096ace-4c51-4c8f-bae2-15a6fd90f6e9");

        #region Redirect
        public static readonly Guid MedianamikRedirectFrom = new Guid("ED0D02CB-E44B-4E87-B4FD-1E5BEE1DD15D");
        public static readonly Guid MedianamikRedirectTo = new Guid("1032ED3D-1535-47B6-8BB6-49E031E90DC0");
        public static readonly Guid MedianamikRedirectQS = new Guid("75FD2E7B-74DE-4F58-9F2D-0C7CDF273AC4");
        public static readonly Guid MedianamikRedirectCode = new Guid("83834CBA-13B2-4755-89C5-7BF1B911880B");
        #endregion

        #region BaseContentType

        public static readonly Guid Name = new Guid("35a3f17a-a4c8-4331-9e8f-10fc27c18445");
        public static readonly Guid UseInChildUrls = new Guid("2FE3A895-6566-4AD0-9803-72D46C7958F5");

        #endregion

        #region Syndication

        public static readonly Guid SyndicatedNode = new Guid("0e468559-56e7-42cd-9327-43e01256ac00");

        #endregion

        #region Domain

        public static readonly Guid Domain_Website = new Guid("7558DCB0-4763-4C99-AF3A-500B2277A9DA");
        public static readonly Guid Domain_Group = new Guid("07168B78-84CC-496D-800B-FB047096164C");
        public static readonly Guid DomainCulture = new Guid("0a797719-02ab-4f75-8fe6-fd17972c0fd1");
        public static readonly Guid MedianamikExternalRedirectFrom = new Guid("ac95ac53-cf22-443f-858b-75c8f8f1f609");
        public static readonly Guid MedianamikExternalRedirectTo = new Guid("590121ff-8cab-476c-bdb2-a92b608e9bab");
        public static readonly Guid MedianamikExternalRedirectCode = new Guid("51d60a90-76ec-4cb8-8a47-b3c5a7e71a35");

        #endregion
    }

    public static class MedianamikControls
    {
        public static Guid SingleLineTextBox = new Guid("7E4BA709-965E-42DD-92B8-028DDCED0D7C");
        public static Guid MultiLineTextBox = new Guid("3B55A6D8-2733-428C-9994-05D9BBAB3D1E");
        public static Guid LiteEditor = new Guid("AD890B8C-72ED-43A8-9B91-85F5B1B23BC0");
        public static Guid Editor = new Guid("9199AD59-E2DF-4D53-B404-3F8D612BCCB5");
        public static Guid IntTypedTextBox = new Guid("A4E3E63C-3203-451E-91ED-114072EBAA13");
        public static Guid DoubleTypedTextBox = new Guid("53538FF9-2C76-43F4-BCD2-8857627CBD4C");
        public static Guid CheckBox = new Guid("09BBED40-5BEB-434F-ABB2-4F46FB29B86E");
        public static Guid DatePicker = new Guid("A375D198-37E5-4033-9FFA-F430C7063DE8");
        public static Guid DropDownList = new Guid("59B66D0C-8BFF-4802-B83A-977E11797677");
        public static Guid ManyToOneCheckBoxList = new Guid("688c77d1-a5a1-4d1c-84a3-22cdd5a109cb");
    }

    public static class DataTypes
    {
        public static readonly Guid Bit = new Guid("e7293d5e-0b55-4ff1-a24a-b4969b187a19");
        public static readonly Guid Int = new Guid("802952bb-56c8-4ab2-9e53-1ed7c4b07e9f");
        public static readonly Guid Float = new Guid("115d0aeb-b145-4f4c-b5c5-56d6c4216f42");
        public static readonly Guid DateTime = new Guid("87cf5a6e-dee6-49ce-a22b-9e69b11e351f");
        public static readonly Guid Varchar = new Guid("195f6f67-f42d-428b-be3e-ad8762cde76f");
        public static readonly Guid UniqueIdentifier = new Guid("0d5b7a19-a12a-46b5-9a2c-8d15093f5666");
        public static readonly Guid NVarcharMax = new Guid("d45c7af5-3c9f-40cd-82fe-d09c03faf7fe");

        public static readonly Guid[] StringDataTypes = new Guid[] { Varchar, NVarcharMax };
    }

    public static class PropertyDefinitions
    {
        public static readonly Guid ShortTextPropertyId = new Guid("748da805-5d02-4ba5-a6be-f8578f2d2e19");
        public static readonly Guid MediumTextPropertyId = new Guid("26537c5d-3b3b-4696-a4e8-ad7ec698d827");
        public static readonly Guid LongTextPropertyId = new Guid("5b0a7907-c699-4e67-87d4-d0cfe34276f3");
        public static readonly Guid OneToManyPropertyId = new Guid("e3fede68-2486-47ef-99d0-4ed94bd5d656");
        public static readonly Guid ManyToOnePropertyId = new Guid("15d0515d-8275-40e3-be5c-29ec4f4169f8");
        public static readonly Guid IntPropertyId = new Guid("9f75ab92-978c-43ce-bfd8-c685283f5ea8");
        public static readonly Guid FloatPropertyId = new Guid("6e370734-0541-4da2-985b-551196bc4612");
        public static readonly Guid DateTimePropertyId = new Guid("5eb159d7-cb57-448f-96e5-0c7e2a65d033");
        public static readonly Guid BitPropertyId = new Guid("f1088c94-6877-4cae-8850-f0498a969eab");

        public static readonly Guid[] TextPropertyDefinitions = new Guid[] { ShortTextPropertyId, MediumTextPropertyId, LongTextPropertyId };

        public static readonly ReadOnlyCollection<PropertyDefinition> Definitions = new List<PropertyDefinition>
        {
            new PropertyDefinition(ShortTextPropertyId, DataTypes.Varchar, MedianamikControls.SingleLineTextBox, new MedianamikControlInfo(), 250),
            new PropertyDefinition(MediumTextPropertyId, DataTypes.Varchar, MedianamikControls.LiteEditor, new MedianamikControlInfo(new Unit(90, UnitType.Percentage), 300), 2000),
            new PropertyDefinition(LongTextPropertyId, DataTypes.NVarcharMax, MedianamikControls.Editor, new MedianamikControlInfo(new Unit(90, UnitType.Percentage), 500), null),
            new PropertyDefinition(OneToManyPropertyId, DataTypes.Varchar, MedianamikControls.DropDownList, new MedianamikControlInfo(), 250),
            new PropertyDefinition(ManyToOnePropertyId, DataTypes.NVarcharMax, MedianamikControls.ManyToOneCheckBoxList, new MedianamikControlInfo(), null),
            new PropertyDefinition(IntPropertyId, DataTypes.Int, MedianamikControls.IntTypedTextBox, new MedianamikControlInfo(), null),
            new PropertyDefinition(FloatPropertyId, DataTypes.Float, MedianamikControls.DoubleTypedTextBox, new MedianamikControlInfo(), null),
            new PropertyDefinition(DateTimePropertyId, DataTypes.DateTime, MedianamikControls.DatePicker, new MedianamikControlInfo(), null),
            new PropertyDefinition(BitPropertyId, DataTypes.Bit, MedianamikControls.CheckBox, new MedianamikControlInfo(), null)
        }.AsReadOnly();
    }

    public static class PropertyValidationExpressions
    {
        public static readonly Guid UrlId = new Guid("E08DD244-37F6-43A7-95B1-09E687F46D52");
        public static readonly Guid EmailId = new Guid("86E13984-32EA-409C-BDE0-7A657E9F38D5");
        public static readonly Guid AlphaId = new Guid("57BE623E-4CD8-4DE4-BABB-D99935234228");
        public static readonly Guid NumericId = new Guid("92992CE1-79E7-456B-A97A-6D4214BAF863");
        public static readonly Guid AlphaNumericId = new Guid("2F3EC07D-4EA8-41BE-B647-4D0C0362EBCD");

        public static readonly Regex Url = RegularExpressions.Url;
        public static readonly Regex Email = new Regex(@"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");
        public static readonly Regex Alpha = new Regex(@"^[a-zA-Z]+$");
        public static readonly Regex Numeric = new Regex(@"^[0-9]+$");
        public static readonly Regex AlphaNumeric = new Regex(@"^[a-zA-Z0-9]+$");

        public static readonly ReadOnlyCollection<PropertyValidationExpression> Expressions = new List<PropertyValidationExpression>
        {
            new PropertyValidationExpression(UrlId, Url),
            new PropertyValidationExpression(EmailId, Email),
            new PropertyValidationExpression(AlphaId, Alpha),
            //new PropertyValidationExpression(NumericId, Numeric),
            new PropertyValidationExpression(AlphaNumericId, AlphaNumeric),
        }.AsReadOnly();
    }

    public static class ResourceSets
    {
        public const string SiteMap = "SiteMap";
        public const string Tabs = "Medianamik_Tabs";
    }

    public static class RegularExpressions
    {
        //public static readonly Regex GuidInDocument = new Regex(@".@(?<id>(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}).@", RegexOptions.Compiled);
        public static readonly Regex MedianamikLink = new Regex(@"(?<TagStart>href=""?)(?<crap>[^\@>]*)\.@(?<id>[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12})(?<culture>\|culture=[a-zA-Z]{1,5}-[a-zA-Z]{1,5})?(?<culture>\|culture=[a-zA-Z]{0,5}-[a-zA-Z]{0,5})?(?<anchor>\|anchor=[0-9a-zA-Z]{0,50})?(?<protocol>\|protocol=[a-zA-Z]{0,5})?\.@", RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
        // La regex suivante est compilée en CIL (option Compiled) pour augmenter la performance.
        //public static readonly Regex Url = new Regex(@"(?#Protocol)(?:(?:ht|f)tp(?:s?)\:\/\/|~/|/)?(?#Username:Password)(?:\w+:\w+@)?(?#Subdomains)(?:(?:[-\w]+\.)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[\d]{1,5})?(?#Directories)(?:(?:(?:/(?:[-\w~!$+|.,=]|%[a-f\d]{2})+)+|/)+|\?|#)?(?#Query)(?:(?:\?(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)(?:&(?:[-\w~!$+|.,*:]|%[a-f\d{2}])+=(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)*)*(?#Anchor)(?:#(?:[-\w~!$+|.,*:=]|%[a-f\d]{2})*)?", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        public static readonly Regex Url = new Regex(@"((https?|ftp|gopher|telnet|file|notes|ms-help):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);
        public static readonly Regex HrefUrl = new Regex(@"href=""(?<url>.+?)""");
    }

    public static class ProviderName
    {
        public const string ProfileProviderName = "MedianamikProfileProvider";
    }

    public static class Skins
    {
        public const string DEFAULT_SKIN = "Default";
        public const bool DEFAULT_USE_EMBEDDED_SKIN = true;
    }
}
